<!--
@Time : 2020/12/7 2:34 下午
@Author : yekong
@File : yaoqing.vue
@Software : PhpStorm
-->
<template>
  <div>
    <div class="yonghu">人数:{{ list.length }}</div>
    <el-table :data="list" border style="width: 100%">
      <el-table-column prop="nickName" label="昵称"></el-table-column>
      <el-table-column prop="id" label="用户id">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "yaoqing",
  data: function () {
    return {
      list: [],
      total: 0
    }
  },
  props: {
    id: {
      type: Number,
      default() {
        return 0;
      }
    }
  },
  created: function () {

  },
  filters: {},
  methods: {
    getdata() {
      let url = "/user/codeList";
      let params = {
        id: this.id,
      };
      this.httpPost(url, params, res => {
        if (res.code == 200) {
          this.total = res.data.total;
          this.list = res.data.list;
        }
      });
    },
  },
  mounted() {
    this.getdata()
  },
}
</script>

<style lang="scss" scoped>
.yonghu {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  font-size: 16px;
  margin-bottom: 20px;
  color: #999;
}
</style>
